import type {
  DetailContract,
  PageContract,
  QueryContractAssetlConfirm,
  QueryPageContract,
  Result,
} from '@/config/data/data'
import { get, post } from './request'

/**
 * 根据状态分页查询合同
 * @param data 参数对象
 * @returns 多条数据
 */
export const ReqSelectPageContractByState = (
  data: QueryPageContract
): Promise<Result<PageContract[]>> => get('/contractual/page/state', data)

/**
 * 根据id查询合同内容
 * @param data 参数对象
 * @returns 单条数据
 */
export const ReqSelectDetailContract = (data: {
  id: number
}): Promise<Result<DetailContract>> => get('/contractual/detail', data)

/**
 * 合同最终确认
 * @param data 参数对象
 * @returns 单条数据
 */
export const ReqContractFinalConfirm = (data: {
  id: number
}): Promise<Result<boolean>> => get('/contractual/final/confirm', data)

/**
 * 合同资产确认
 * @param data 参数对象
 * @returns 单条数据
 */
export const ReqContractAssetConfirm = (
  data: QueryContractAssetlConfirm
): Promise<Result<boolean>> => post('/contractual/asset/confirm', data)

/**
 * 合同重要内容确认
 * @param id 合同编号
 * @returns 单条数据
 */
export const ReqContractImportantConfirm = (data: {
  id: number
}): Promise<Result<boolean>> => get('/contractual/important/confirm', data)
